<?php
/**
 * Created by PhpStorm.
 * User: beiqing
 * Date: 2017/11/16
 * Time: 上午10:37
 */

namespace App\Model;


use Illuminate\Database\Eloquent\Model;

class Temp extends Model
{
    const STOCK='stock';//股票key
    // protected $table = 'aixin_temps';
    public $timestamps = false;
    //更新股票数据
    public function updateStock($value){
        return self::where('key_name',self::STOCK)->update(['key_value'=>$value,'updated_at'=>time()]);
    }
    //获取股票数据
    public function getStock(){
        return self::where('key_name',self::STOCK)->first();
    }

}